{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# Regression Plots\n", "\n", "Seaborn has many built-in capabilities for regression plots, however we won't really discuss regression until the machine learning section of the course, so we will only cover the **lmplot()** function for now.\n", "\n", "**lmplot** allows you to display linear models, but it also conveniently allows you to split up those plots based off of features, as well as coloring the hue based off of features.\n", "\n", "Let's explore how this works:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import seaborn as sns\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "tips = sns.load_dataset('tips')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | total_bill | \n", "tip | \n", "sex | \n", "smoker | \n", "day | \n", "time | \n", "size | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "16.99 | \n", "1.01 | \n", "Female | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
1 | \n", "10.34 | \n", "1.66 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "3 | \n", "
2 | \n", "21.01 | \n", "3.50 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "3 | \n", "
3 | \n", "23.68 | \n", "3.31 | \n", "Male | \n", "No | \n", "Sun | \n", "Dinner | \n", "2 | \n", "
4 | \n", "24.59 | \n", "3.61 | \n", "Female | \n", "No | \n", "Sun | \n", "Dinner | \n", "4 | \n", "